package org.csu.mypetstore.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.csu.mypetstore.domain.PO.Item;

public interface ItemMapper extends BaseMapper<Item> {

//    @Update("UPDATE INVENTORY SET QTY = QTY - #{param.get(\"increment\")} WHERE ITEMID = #{param.KeySet().iterator().next()}")
//    public void updateInventoryQuantity(@Param("param") Map<String, Object> param);
//
//    @Select("SELECT QTY AS QUANTITY FROM INVENTORY WHERE ITEMID = #{itemId}")
//    public int getInventoryQuantity(String itemId);
//
//    @Select("SELECT I.ITEMID,LISTPRICE,UNITCOST,SUPPLIER AS supplierId,I.PRODUCTID AS" +
//            " productId,NAME AS productName,DESCN AS productDescription,CATEGORY AS categoryId," +
//            "STATUS,ATTR1 AS attribute1,ATTR2 AS attribute2,ATTR3 AS attribute3,ATTR4 AS attribute4," +
//            "ATTR5 AS attribute5 FROM ITEM I, PRODUCT P WHERE P.PRODUCTID = I.PRODUCTID AND I.PRODUCTID = #{productId}")
//    public List<Item> getItemListByProduct(String productId);
//
//    @Select("select I.ITEMID,LISTPRICE,UNITCOST,SUPPLIER AS supplierId,I.PRODUCTID AS productId,NAME " +
//            "AS productName,DESCN AS productDescription,CATEGORY AS CategoryId,STATUS,ATTR1 AS attribute1," +
//            "ATTR2 AS attribute2,ATTR3 AS attribute3,ATTR4 AS attribute4,ATTR5 AS attribute5,QTY AS quantity " +
//            "from ITEM I, INVENTORY V, PRODUCT P where P.PRODUCTID = I.PRODUCTID and I.ITEMID = V.ITEMID " +
//            "and I.ITEMID=#{itemId}")
//    public Item getItem(String itemId);

}
